import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "home",
    meta: {
      istrun: true,
    },
    component: () => import("../components/HomeView.vue"),
  },
  {
    path: "/login",
    name: "login",
    meta: {
      istrun: false,
    },
    component: () => import("../views/LoginView.vue"),
  },
  {
    path: "/register",
    name: "register",
    component: () => import("../components/Register.vue"),
  },
  {
    path: "/class",
    name: "class",
    meta: {
      istrun: true,
    },
    component: () => import("../components/ClassifyView.vue"),
  },
  {
    path: "/ShoppingCart",
    name: "ShoppingCart",
    meta: {
      istrun: true,
    },
    component: () => import("../views/ShoppingCart.vue"),
  },
  {
    path: "/OrderConfirm",
    name: "OrderConfirm",
    component: () => import("../components/OrderConfirm.vue"),
  },
  {
    path: "/addressEdit",
    name: "addressEdit",
    component: () => import("../components/AddressEdit.vue"),
  },
  {
    path: "/paymentresult",
    name: "paymentresult",
    component: () => import("../components/PaymentResult.vue"),
  },
  {
    path: "/shopping",
    name: "shopping",
    meta: {
      istrun: false,
    },
    component: () => import("../views/ShoppingView.vue"),
  },
  {
    path: "/my",
    name: "my",
    meta: {
      istrun: true,
    },
    component: () => import("../components/My.vue"),
  },
  {
    path: "/search",
    name: "search",
    component: () => import("../components/SearchView.vue"),
  },
  {
    path: "/OrderConfirm",
    name: "OrderConfirm",
    component: () => import("../components/OrderConfirm.vue"),
  },
  {
    path: "/coupon",
    name: "coupon",
    component: () => import("../components/Coupon.vue"),
  },
  {
    path: "/address",
    name: "address",
    component: () => import("../components/Address.vue"),
  },
  {
    path: "/shoppingCollect",
    name: "shoppingCollect",
    component: () => import("../components/ShoppingCollect.vue"),
  },
  {
    path: "/footprint",
    name: "footprint",
    component: () => import("../components/Footprint.vue"),
  },
  {
    path: "/AddressEditChirld",
    name: "AddressEditChirld",
    component: () => import("../components/AddressEditChirld.vue"),
  },
  {
    path: "/Comment",
    name: "Comment",
    component: () => import("../components/Comment.vue"),
  },
  {
    path: "/MyOrders",
    name: "MyOrders",
    component: () => import("../components/MyOrders.vue"),
  },
  {
    path: "/Orderdetails",
    name: "Orderdetails",
    component: () => import("../components/Orderdetails.vue"),
  },
  {
    path: "/Subcategories",
    name: "Subcategories",
    component: () => import("../components/Subcategories.vue"),
  },
  {
    path: "/brand",
    name: "brand",
    component: () => import("../components/BrandVIew.vue"),
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
